/*
* @file model/infoRevise.js
*  个人设置/密码修改
* @author
*
*/
import { routerRedux } from 'dva/router';
import api from '../api';
import { notification } from 'antd';

export default{
	namespace:"passwedit",
	state:{

	},
	subscriptions:{
	},
	effects:{
		*savepassword({payload:query},{call,put}){
			// console.log("sssssssss",query)
			const response = yield call(api.savepassword, query);
			yield put({
				type: 'saveSuccess',
				payload: response ,
			})
		}
	},
	reducers:{
		saveSuccess(state, {payload}) {
			// const { payload: { response } } = action;
			console.log("action>>>",payload)
			if(payload.code === 0){
				notification['success']({
			    message: '保存成功',
			  });
			}else if(payload.code === 1){
				notification['error']({
			    message: payload.msg,
			  });
			}
		}
	}
}